import { post } from "../../../utils/request";
import { getCurrentTenant } from '../../../utils/utils';

// 渠道类型查询方法
const channelsTypes = data => post("mgt/channel/channelsTypes", data);

const channelsupdateStatus = data => post("mgt/channel/updateStatus", data);

const dingcompanygrouplist = data => post("mgt/dingding/dingcompanygrouplist", data);

// 渠道注册
const commit = data => post("mgt/channel/commit", { ...data, tenantCode: (getCurrentTenant() || { tenantCode: '' }).tenantCode[0] });

const save = data => post("mgt/channel/save", data);

// 联通性测试
const test = data => post("mgt/channel/test", data);

export default {
  channelsTypes,
  commit,
  test,
  save,
  channelsupdateStatus,
  dingcompanygrouplist,
};
